In Game Commands 
==== Terms used here: ====
* OnTime = Time on the server.  (The epoch event is the first time that OnTime service is installed and started on the server.)
* //current OnTime// = Time on the server since last login event.
* //today OnTime// = Time on the server for the current day (since midnight)
* //total OnTime// = Time on the server since the first login.

== General Usage: ==
=== /ontime [keyword] <parameters> {optional}===
\\
> All commands (except where noted) can be executed from the console or in game.
\\
== Player Commands: ==
=== /ontime ===
>	Provides the sender with their //current OnTime//, //daily/weekly OnTime//, and //total OnTime//. 
>   This command cannot be executed from the console.

=== /ontime help ===
>	Provides the sender with a list of available OnTime commands according to their permission settings.

=== /ontime top <#> ==
>	Provides the sender with a list of players ranked by //total OnTime//.  The number of players to include in the list must be specified <#>.

=== /referred by <playerName>
>  Executed by a player who has been referred to the server by another player.  The referring player will receive a reward once the referred player has been on the server for a time specified by the administrator.

\\
\\
\\
== Player/Administrator Commands: ==
=== /ontime <player name> ===
> This provides the sender with information such as the # days on, # different days, last login, //current OnTime, daily/weekly OnTime, and total OnTime//, and scheduled reward(s) for the specified player.  If the player is online then shortened versions of the ID can be used.  If offline, the complete player name must be specified. 

The output including the content, wording, and color is configurable.

=== /ontime top {<#> [total/today/week/month] {[+login/+today/+week/+month]}} ===
> Provides the sender with a list of players ranked by //total OnTime//.  The number of players to include in the list can be specified by <#>. If no number is specified the max number configured will be used.

>The scope of the list can be specified to be //Total OnTime// or daily/weekly/monthly //OnTime//.  If no scope is specified //Total OnTime// will be displayed.

>When //Total OnTime// is specified, each listed player's last login (+login) or daily/weekly/monthly (+today or +weekly or +monthly) data can be added to the output.  Only one extended info ( '+login'/+today/+week/+month' can be specified in a single command. 

//*As of version 3.0 0, daily, weekly, and monthly data can be collected simultaneously.
\\
examples

> /ontime top

> /ontime top 5

> /ontime top 10 weekly

> /ontime top 10 total +login

=== /ontime online [total] ===
> Provides the sender with a list of players that are currently online showing their //total OnTime//.  This is the default if neither current nor total is specified after the online keyword.

=== /ontime online current ===
> Provides the sender with a list of players that are currently online showing their //current OnTime//.  
\\
\\
== Admin Commands: ==

===/ontime add <player name> <dd> <hh> <mm>===
> Will add to the players current //total OnTime// the time specified by <dd>=days, <hh>=hours, and <mm>=minutes. 

===/ontime backup === 
> Generates backup versions of the //OnTime// .dat files in the /plugin/ontime/backup directory. 

===/ontime export [dat/mysql/yml]
> Exports the player data to the specified format.  This command would be used when the admin wants to change from one storage method to another, or they want to export OnTime data for other uses.

===/ontime import logblock {[replace]}
> Imports player data (playername, total playtime) from the MYSQL data table created by the logblock plugin.  (See [[http://dev.bukkit.org/server-mods/ontime/pages/other-functions/|Ohter Functions]] Page for more info.)
> If the keyword 'replace' is included at the end of the command any player's //total OnTime// that is already stored in the OnTime database, will be replaced with the contents of the imported database.

===/ontime import yml <filename> {replace}
> Imports player data (playername, total playtime) from a .yml file.  This provides a method to create //total OnTime// data file from another plugin or hand edited file. (See [[http://dev.bukkit.org/server-mods/ontime/pages/other-functions/|Ohter Functions]] Page for more info.)
> If the keyword 'replace' is included at the end of the command any player's //total OnTime// and last login data that is already stored in the OnTime database, will be replaced with the contents of the imported file.

=== /ontime online next === 
>//alternative: '/ontime rewards next' //
>Displays the time until and value of the next reward(s) to be issued to each player currently online.

=== /ontime report ===
> Generates a report (.txt or .htm) file in the /plugin/ontime directory containing a list of players in the OnTime data files, showing //total OnTime// and timestamp of last login, ordered by //total OnTime//.  The file name includes the date of the report generation request.

> Also generates a report (.txt or .htm) file in the same directory containing a list of players on the server for the current day, week, or month, ordered by //daily/weekly/monthly OnTime//.  This file name includes the date of the data included in the report.

> Previous versions of report files will be overwritten.
> The format (.txt vs .htm) and enabled reporting periods (daily. weekly, monthly) are all set via the //OnTime config.yml//.

===/ontime remove <player name>==
> Removes the specified user from the //OnTime// data files.  This can only be run for offline players.

===/ontime rewards add [command/econ/group/item/perm/xp] {parameters see below}
> Adds a new //OnTime Reward// level to the reward set.  When a player with permission to receive //OnTime Rewards// reaches the point where their Total OnTime equals the duration specified, they will be automatically issued the reward specified.  The remainder of the format of the command depends on the type of reward as follows:

==== **Command Reward**
====/ontime rewards add command <dd> <hh> <mm> <commandID>
>//shorthand: '/ontime rw add cmd <dd> <hh> <mm> <commandID>'//

> The //reward time// is specified as <dd> = days, <hh> = hours, and <mm> = minutes.  <commandID> is the command identifier defined in the rewards.yml file for execution.

Example: To give a player 'creative mode' when a player has been on the server for 3 day and 1 hour: 
>**>ontime rewards add 3 1 0 creative**
NOTE: This requires 'creative' to be defined in the rewards.yml file.

==== **Economics Reward**
====/ontime rewards add econ <dd> <hh> <mm> <amount>

> The //reward time// is specified as <dd> = days, <hh> = hours, and <mm> = minutes.  <amount> is the size of the economics award granted.

Example: To add a new reward of $100 when a player has been on the server for 1 day: 
>**>ontime rewards add 1 0 0 100**

==== **Group Reward**
====/ontime rewards add group <dd> <hh> <mm> <group name>
> The //reward time// is specified as <dd> = days, <hh> = hours, and <mm> = minutes.  <group name> is the name of the permissions group to which the player should be assigned at the specified time.

Example: To add a new reward of group change to 'Builder' when a player has been on the server for 1 hour: 
>**>ontime rewards add 0 1 0 Builder**

==== **Item Reward**
====/ontime rewards add item <dd> <hh> <mm> <quantity> [<item ID>/<item name>]
> The //reward time// is specified as <dd> = days, <hh> = hours, and <mm> = minutes.  <quantity> is the number of the items to give the player.  The MC item can be specified by Item ID or Item Name.

Example: To add a new reward of 2 Diamonds when a player has been on the server for 1 day 12 hours: 
>**>ontime rewards add 1 12 0 2 DIAMOND**

==== **Permission Reward**
====/ontime rewards add perm <dd> <hh> <mm> <permission>
> The //reward time// is specified as <dd> = days, <hh> = hours, and <mm> = minutes.  <permission> is the permission string to be added to the player's permission list at the specified time.

Example: To add a new reward of permission add of 'ontime.other' when a player has been on the server for 1 day and 1 hour: 
>**>ontime rewards add 1 1 0 ontime.other**

==== **XP Reward**
====/ontime rewards add xp <dd> <hh> <mm> <points>
> The //reward time// is specified as <dd> = days, <hh> = hours, and <mm> = minutes.  <points> is the amount of XP (experience points) to award to the player at the specified time.

Example: To add a new reward of 100 XP when a player has been on the server for 30 minutes: 
>**>ontime rewards add xp 0 0 30 100**

=== /ontime rewards edit time <rewardID> <dd> <hh> <mm>
> Enables administrator to modify the //total OnTime// for the specified reward.  The rewardID is the order number provided by the '/ontime rewards list' command.

=== /ontime rewards exclusive [add/remove] <rewardID> {<group List>}
>//shorthand: '/ontime rw excl [add/remove] <rewardID> {<group List>}

>//Also see '/ontime rewards general'

> Makes an OnTime Reward exclusive to specific permissions 'groups'.  The groups listed when the 'add' keyword is used will become eligible to receive the specified reward.  The groups listed when the 'remove' keyword is used will no longer be eligible to receive the specified reward.  The rewardID is the order number provided by the '/ontime rewards list' command.

=== /ontime rewards delete <player name>=== 
>//shorthand: '/ontime rw delete <player name>'//

> Deletes any individual (indi) awards pending for the specified player.

=== /ontime rewards general <rewardID>
>//shorthand: '/ontime rw gen <rewardID> 

>//Also see '/ontime rewards exclusive'

> Makes an OnTime Reward available to all players.  (No longer requires permission group membership.) The rewardID is the order number provided by the '/ontime rewards list' command.

=== /ontime rewards indi <rewardID>
>Makes an existing reward a 'individual only' reward.  The rewardID is the order number provided by the '/ontime rewards list' command.  An individual reward will never be issued automatically.
>NOTE: When a rewards 'individual' flag is set, it will automatically be put to the end of the rewards list, so the RewardID may change.

=== /ontime rewards info <rewardID>
>Displays to the player the detailed definition of the specified reward.  The rewardID is the order number provided by the '/ontime rewards list' command.  The information included is:
*RewardID
*Reward Type
*Reward Flags
*Reward Issue time
*Reward Recurrence interval (for recurring/perpetual rewards)
*Reward Permission String (for exclusive rewards)
*Reward Permission Groups (for exclusive rewards)

=== /ontime rewards perp <rewardID> <dd> <hh> <mm>
>Makes an existing reward a perpetual reward at the interval specified by <dd> = days, <hh>=hours, <mm>=minutes.  The rewardID is the order number provided by the '/ontime rewards list' command.
>This is only applicable to command, econ, item and xp reward types.
>The difference between 'perpetual' and 'recurring' rewards is that 'perpetual' rewards are given forever once the //start Total OnTime// is reached, and therefore multiple perpetual rewards can be active at the same time for a given player.   A 'recurring' reward will only repeat until the next defined reward time is reached, and only one 'recurring' reward is ever active at one time.

=== /ontime rewards list {<#>} === 
>//shorthand: '/ontime rw l {<#>}'//

> List the currently configured //OnTime Rewards//.  Nine levels will be listed per 'page'. Additional pages can be displayed by entering optional page number (<#>).  Page 1 is shown by default.  (When executed from the console paging is not used and all rewards are shown with a single command.)
> The 'RewardID' used in other commands is provided by this command.

=== /ontime rewards next === 
>//alternative: '/ontime online next' //
>Displays the time until and value of the next reward to be issued to each player currently online.

=== /ontime rewards recur <rewardID> <dd> <hh> <mm>
>Makes an existing reward a recurring reward at the interval specified by <dd> = days, <hh>=hours, <mm>=minutes.  The rewardID is the order number provided by the '/ontime rewards list' command.
>This is only applicable to command, econ, item and xp reward types.
>The difference between 'perpetual' and 'recurring' rewards is that 'perpetual' rewards are given forever once the //start Total OnTime// is reached, and therefore multiple perpetual rewards can be active at the same time for a given player.   A 'recurring' reward will only repeat until the next defined reward time is reached, and only one 'recurring' reward is ever active at one time.

=== /ontime rewards refer <rewardID> === 
>//shorthand: '/ontime rw refer <rewardID>'//

>Identifies a reward as a 'referred by' reward.  The specified //total OnTime// for the reward is the //total OnTime// the referred player must play before the reward will be issued to the referring player.

=== /ontime rewards remove <rewardID> === 
>//shorthand: '/ontime rw rm <rewardID>'//

>Removes the specified (<rewardID>) //OnTime Reward// from the reward set.  The rewardID is the reward order number displayed in the '/ontime reward list' command output.  Please note that new 'order numbers' are reassigned after each removal, so be careful when removing multiple rewards at one time.

=== /ontime rewards single <rewardID>
>Makes an existing reward a single occurrence reward.  The rewardID is the order number provided by the '/ontime rewards list' command.

=== /ontime rewards set <player name> [delta/login/ontime/real] <rewardID> {<dd> <hh> <mm>}
>Sets an individual (indi) reward for the specified player.  The rewardID is the order number provided by the '/ontime rewards list' command, and can be any reward in the reward list.  The time setting for automated execution of the reward specified by <rewardID> will be replaced with the relative time specified as <dd> = days, <hh> = hours, and <mm> = minutes.  This relative time will be interpreted as:
*delta = Reward will be issued when the player has been online for the specified amount of time longer from their current //Total OnTime//
*login = Reward will be issued on the player's next server login. (<hh> <mm> <ss> are not needed)
*ontime = Reward will be issued when the player's //Total OnTime// reaches the specified time.
*real = Reward will be issued the specified amount of real (server) time in the future.  If the player is not online when this time is reached, the award will be issued on the player's next login to the server.

=== /ontime rewards top <rewardID> [daily/weekly/monthly/total] <startPlace> {<endPlace>}
>Makes an existing reward a "top player" reward.  At the start of each new day the system will check for 'top' rewards and if configured will issue rewards to the 1st, 2nd, 3rd, etc. player in that list, per the configuration.  For this command, the <rewardID> is the order number for the intended 'top player' reward, as provided by the '/ontime rewards list' command. [daily, weekly, monthly, total] indicates which 'top list' should be used to determine which player's get rewards.  <StartPlace> is a required parameter and is the place ("1"st, "2"nd, "3"rd, etc.) that is to recieve the reward.  The optional <EndPlace> can be specified and all places in the range between and including <StartPlace> and <EndPlace> will recieve the reward.

=== /ontime save ===
> Performs a forced save of in-memory data to disk storage files.   (Configuration allows for scheduled saves to occur, and a save is always done on server shutdown.)

===/ontime set [days/total] <player name> <dd> {<hh> <mm>}==
> 'set total' will set the player's //Total OnTime// to the time specified by <dd>=days, <hh>=hours, and <mm>=minutes. 
> 'set days' will set the player's //different days on// to the number of days specified by <dd>

=== /ontime test login <player name> <time offset> ===
> Adds a player to the OnTime data.  <time offset> can be a positive or negative number.  

>If <time offset > is positive the player login time stamp will be <time offset> **hours** prior to the current (command execution) time, and their //total OnTime// will be set to <time offset> hours. 

>If <time offset > is negative the player login time stamp will be <time offset> **days** prior to the current (command execution) time, and their //total OnTime// will still be set to <time offset> hours. 

>If <time offset> is zero the player login time stamp will be the current (command execution) time, and their //total OnTime// will be still be set to zero.

>This was originally added for development purposes, but I thought it might have some use on a player server.  (Make your server look more popular that it really is . ;-)) 

=== /ontime test yesterday===
> This will change the 'day' for the recorded //today OnTime // data to the previous day.  After this is done the next player login/quit event or server reset may result in the auto generation of a 'daily/weekly' report, and clearing of the daily data file for a 'new' day/week.